
AddComponentPostInit("temperature", function(Temperature)
    if not Temperature.inst:HasTag("player") then return end 

    local oldSetTemperature = Temperature.SetTemperature
    function Temperature:SetTemperature(value, ...)
        local min = self.inst.i26wendu_min and self.inst.i26wendu_min:IsValid() and 10 or nil
        local max = self.inst.i26wendu_max and self.inst.i26wendu_max:IsValid() and 60 or nil
        if min ~= nil and value < min then
            value = min
        elseif max ~= nil and value > max then
            value = max
        end
        return oldSetTemperature(self, value, ...)
    end
end)